int cmp_int(const void* e1, const void* e2) {
	return *(int*)e1 - *(int*)e2;
}
int deleteGreatestValue(int** grid, int gridSize, int* gridColSize) {
	int i = 0;
	int ans = 0;
	for (i = 0; i < gridSize; i++) {
		qsort(grid[i], *gridColSize, sizeof(int), cmp_int);
	}
	int j = 0;
	int y = *gridColSize - 1;
	while (y >= 0) {
		int max = grid[0][y];	
		for (j = 1; j < gridSize; j++) {
			if (max < grid[j][y]) {
				max = grid[j][y];
			}
		}
		ans += max;
		y--;
	}
	return ans;
}